#!/bin/bash

PIMONHOME=${PIMONHOME:-/etc/pi-mon}

while true
do
    out=""
    for t in $PIMONHOME/tests.d/*.test
    do
        [[ -x $t ]] && out="$out$($t)"
    done

    if [ -z "$out" ]
    then
        ledclient g
    else
        ledclient rrrrrxxx$(morsecode --mode=pi --wspace=xrx --end=xxx "$out")
    fi
    sleep 10
done
